<template>
   <!--公用底部-->
    <footer class="footer">
      <div class="container">
        <div class="copyright">
          <ul class="co">
            <li class="fo">
              <router-link to="/">小明的前端随笔</router-link>&copy;2017</li>
            <li class="fo foh">支持国产</li>
            <li class="fo foh"><i class="fa fa-hand-o-right"></i> Theme By </li>
          </ul>
        </div>
      </div>
    </footer>
    <!--底部end-->
</template>
<style>
</style>
<script>
// vue-ajax
import util from '~/util/serve';
import axios from 'axios';
export default {
  mounted(){

    // 百度自动提交
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);

    // 百度手动提交
    axios({
      method: 'post',
      url: 'http://data.zz.baidu.com/urls?site=www.stite.net&token=VJHZhQMtaOwLRjcg',
      data: location.href,
      headers: {'Content-type': 'text/plain'}
    }).then(()=>{
      console.log('成功')
    });
  }
}
</script>
